//2009/08/08 12:55:54
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>

using namespace std;

class CubeWalking
{
public:
    string finalPosition(string mov)
    {
        char x[] = {1,0,-1,0};
        char y[] = {0,1,0,-1};
        int dir = 0;
        int xx = 1;
        int yy = 1;
        for (int i=0; i<mov.size(); i++)
        {
            if (mov[i] == 'L')
            {
                dir = (dir + 1 + 4) % 4;
            }
            else if (mov[i] == 'R')
            {
                dir = (dir - 1 + 4) % 4;
            }
            else if (mov[i] == 'W')
            {
                xx = (xx + 3 + x[dir]) % 3;
                yy = (yy + 3 + y[dir]) % 3;
            }
        }
        if (xx == 1 && yy == 1) return "GREEN";
        else if ((xx + yy) % 2 == 0) return "RED";
        else return "BLUE";
    }
};

